﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.InterferenceVolumeQuery.Tree.ObservableCollectionAdv`1
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;


namespace DnProcessSimulateCommands.InterferenceVolumeQuery.Tree;

public class ObservableCollectionAdv<T> : ObservableCollection<T>
{
  public void RemoveRange(int index, int count)
  {
    this.CheckReentrancy();
    (this.Items as List<T>).RemoveRange(index, count);
    this.OnReset();
  }

  public void InsertRange(int index, IEnumerable<T> collection)
  {
    this.CheckReentrancy();
    (this.Items as List<T>).InsertRange(index, collection);
    this.OnReset();
  }

  private void OnReset()
  {
    this.OnPropertyChanged("Count");
    this.OnPropertyChanged("Item[]");
    this.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
  }

  private void OnPropertyChanged(string propertyName)
  {
    this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
  }
}
